package com.jielihaofeng.level2;

/**
 * @author Johnnie Wind
 * @description 自定义异常
 * @date 2021/11/30 14:16
 */
public class MyException extends RuntimeException{

    private static final long serialVersionUID = 1L;

    public MyException() {
    }

    public MyException(String message) {
        super(message);
    }

    public MyException(String message, Throwable cause) {
        super(message, cause);
    }

    public MyException(Throwable cause) {
        super(cause);
    }

    public static void main(String[] args) {
//        throw new MyException("我是中国人");

        try {
            throw new IllegalArgumentException("illegal argument");
        }catch (Exception e){
//            throw new MyException("myException");
//            throw new MyException("myException",e);
            throw new MyException(e);
        }
    }
}
